This program demonstrates how to access the built-in Ethernet Address directly from the ROM or from the NameRegistry for some Power Macs. This is followed by the use of Open Transport to obtain the ethernet address information for all Ethernet cards found.
This program only demonstrates direct ROM access to those Power Macintosh models that include built-in ethernet on the motheboard. This does not include the 44/52/53/54/55/62/63/64/6500 series in which a Comm Slot Ethernet card or PDS Ethernet card is installed. Also not included are the Power PC based Powerbooks which require a PC Card Ethernet. The PowerBook 3400 is supported.
This program sample is useful in the case where the Ethernet port is not connected, but one still wants to get the ethernet address. The sample is written to use OT to obtain the ethernet address of all Ethernet card present. If you remove the second part of the code, along with the dependency of the Open Transport libraries, you can use this program to access the Ethernet address for the support Power Mac systems, even with extensions off.
Implementation Notes
The code first checks for the machine gestalt ID to determine whether the system is supported. For supported systems, the ROM or NameRegistry is accessed for the Ethernet addess.
The code was written with CodeWarrior Pro 3 and tested on multiple machines running a variety of versions of Open Transport.
Caveats
As mentioned above, OT must be active for the program to run. The code can be modified to remove the OT calls. This allows the program to function just to read the built-in ethernet addresses, even with extensions turned off.
This program is not Mac OS X compatible as it implements direct memory access to the System ROM.
Credits and Version History
If you find any problems with this sample, mail <dts@apple.com> with “Attn: Rich Kubota” as the first line of your mail and I’ll try to fix them up.